Windows下错误could not find the Qt platform plugin “windows” in “C:\Qt\XXX”的解决办法

您所在的位置:网站首页 缺少qt platform Windows下错误could not find the Qt platform plugin “windows” in “C:\Qt\XXX”的解决办法

Windows下错误could not find the Qt platform plugin “windows” in “C:\Qt\XXX”的解决办法

2024-01-27 02:16| 来源: 网络整理| 查看: 265

如果报错为could not find the Qt platform plugin “windows” in “”,说明Qt环境变量没有配置好

可参考如下帖子进行配置:qt.qpa.plugin: Could not find the Qt platform plugin “windows“ in_无名小卒000001的博客-CSDN博客使用 MSVC 运行 Qt 程序时提示 qt.qpa.plugin: Could not find the Qt platform plugin “windows“ in解决方法:在环境变量的系统变量中,添加QT_PLUGIN_PATH一项,值为 Qt 安装目录下的 MSVC 的 plugins 文件夹,例如D:\Qt\5.12.10\msvc2017_64\plugins...https://blog.csdn.net/qq_38446366/article/details/116148343

若为in “C:\Qt\XXX”(Qt配置路径),则有可能是环境中包含了多个Qt库,且环境变量PATH 中调用的Qt执行文件优先级顺序与配置的QT_QPA_PLATFORM_PLUGIN_PATH 优先级顺序不一致,导致Qt执行文件调用其它版本Qt依赖库文件,从而无法执行。验证该问题存在可以通过在命令行执行where windeployqt会存在多个版本如图所示 ,可以发现路径中不只存在我们安装的Qt的bin执行路径,还有conda中包括Qt的bin执行路径

  解决方法为:使环境变量PATH中多个Qt的bin文件路径优先级顺序与QT_QPA_PLATFORM_PLUGIN_PATH变量的优先级顺序保持一致,如图所示

 针对conda的Qt在QT_QPA_PLATFORM_PLUGIN_PATH中配置其对应的依赖库目录即可



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3